package com.xuecheng.auth.application.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.xuecheng.auth.application.service.WxLoginApplication;
import com.xuecheng.auth.domain.model.vo.req.WxLoginQry;
import com.xuecheng.auth.domain.service.WxLoginService;
import com.xuecheng.base.exception.XueChengPlusException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Objects;

/**
 * @Author: LiJunXi
 * @Description:
 * @Date: 2024-09-08  15:21
 */
@Service
public class WxLoginApplicationImpl implements WxLoginApplication {

    @Autowired
    private WxLoginService wxLoginService;

    @Override
    public String wxLogin(WxLoginQry wxLoginQry) {
        if (Objects.isNull(wxLoginQry) || Objects.isNull(wxLoginQry.getCode()) || Objects.isNull(wxLoginQry.getState())) {
            throw new XueChengPlusException("参数不能为空");
        }

        return wxLoginService.wxLogin(wxLoginQry);
    }
}
